package com.shine.commonlibrary.utils.api;

/**
 * Created by M_genius on 2017/9/6 14:17.
 * 描述：用于返回服务器的host地址
 */
public class ApiConstants {
    /**
     * 测试环境 1(内网IP)
     */
    public static final String TEST_HOST = "http://192.168.20.11:9091/MobileDoctor/";
    /**
     * 产品环境 2（外网IP）
     */
    public static final String PRODUCTION_HOST = "http://182.139.182.182:9091/MobileDoctor/";

    /**
     * APP采用的Server环境
     * 1、测试环境
     * 2、产品环境
     */
    private static final int SERVER_ENVIRONMENT = 2;


    /**
     * 获取对应的host地址，可以在HostType类中新增类型，返回不同的host地址
     *
     * @param hostType host类型
     * @return host
     */
    public static String getHost(int hostType) {
        String host;
        switch (hostType) {
            case HostType.MOBILE_DOCTOR:
                if (SERVER_ENVIRONMENT == 1) {// 测试地址
                    host = TEST_HOST;
                } else if (SERVER_ENVIRONMENT == 2) {// 产品地址
                    host = PRODUCTION_HOST;
                }
                break;
            case HostType.MOBILE_TEST: //临时测试地址

                host = "http://192.168.30.235:8080/";
                break;
            default:
                host = "";
                break;
        }
        return host;
    }
}
